import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'
import Login from '../views/Login.vue'

//异步
const Nodes = () => import('../views/Nodes.vue')
// const Name = ()=>import('../views/Namelabel/Name.vue')
// const Place = ()=>import('../views/Placelabel/Place.vue')
// const Talk = ()=>import('../views/Talklabel/Talk.vue')
// const Time = ()=>import('../views/Timelabel/Time.vue')


Vue.use(VueRouter)

const routes = [
  {
    path: '',
    component: Index,
    //路由元信息
    meta: {
      isLogin: true,
      title: '首页'
    },
    children: [
      {
        path: '/',
        name: 'Home',
        component: Nodes,
        meta: {
          title: '首页'
        }
      }, {
        path: '/Nodes',
        name: 'Nodes',
        component: Nodes,
        meta: {
          title: '标签集'
        }
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  }
]

const router = new VueRouter({
  routes
})



export default router
